package com.wwfish.cms.service;

import com.wwfish.cms.model.BaseContentDto;
import com.wwfish.cms.model.CMSConstants;

import java.util.Date;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2010-8-18
 * Time: 9:56:15
 * To change this template use File | Settings | File Templates.
 */
public class AuditContentManagerImpl implements AuditContentManager{
    public void draftContent(BaseContentDto dto) {
        dto.setWorkflowStatus(CMSConstants._CONTENT_WORKFLOW_STATUS_DRAFT);
    }

    public void commitContent(BaseContentDto dto) {
        dto.setWorkflowStatus(CMSConstants._CONTENT_WORKFLOW_STATUS_COMMIT);
        dto.setCommitTime(new Date());
    }

    public void approvalContent(BaseContentDto dto) {
        dto.setWorkflowStatus(CMSConstants._CONTENT_WORKFLOW_STATUS_APPROVAL);
        dto.setAuditTime(new Date());
        dto.setPublishTime(new Date());
    }

    public void rejectContent(BaseContentDto dto) {
        dto.setWorkflowStatus(CMSConstants._CONTENT_WORKFLOW_STATUS_REJECT);
        dto.setAuditTime(new Date());
    }

    public void draftContentList(List<BaseContentDto> dto) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void commitContentList(List<BaseContentDto> dto) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void approvalContentList(List<BaseContentDto> dto) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void rejectContentList(List<BaseContentDto> dto) {
        //To change body of implemented methods use File | Settings | File Templates.
    }
}
